package org.eclipse.stp.policy_builder.model.source.wizards.ui;

import java.util.ArrayList;

import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.stp.policy_builder.Activator;
import org.eclipse.stp.policy_builder.model.source.SourceType;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;

public class PolicyBuilderWizard extends Wizard implements IImportWizard {
	 private SourceTypesSelectPage firstPage = null;
	 private SourceParameterPage paramPage = null;
	 private MessageSourcesPage msgPage = null;
	 private ArrayList selectedSources = new ArrayList(); 
	 
	public PolicyBuilderWizard() {
		 IDialogSettings builderSettings =
	            Activator.getDefault().getDialogSettings();
	      IDialogSettings wizardSettings =
	            builderSettings.getSection("PolicyBuilderInputWizard");
	      if (wizardSettings == null)
	         wizardSettings = builderSettings.addNewSection("PolicyBuilderInputWizard");
	      setDialogSettings(builderSettings);
	     
		// TODO Auto-generated constructor stub
	}

	public void addPages(){
		setWindowTitle("Policy Extract Wizard");
		firstPage = new SourceTypesSelectPage();
		addPage(firstPage);
		paramPage = new SourceParameterPage();
		addPage(paramPage);
		msgPage = new MessageSourcesPage();
		addPage(msgPage);
		
	}
	
	@Override
	public boolean performFinish() {
		// TODO Auto-generated method stub
		return true;
	}
	
	
	@SuppressWarnings("restriction")
	@Override
	public void createPageControls(Composite pageContainer){
		firstPage.createControl(pageContainer);
	}
	@Override
	public void init(IWorkbench arg0, IStructuredSelection arg1) {
		// TODO Auto-generated method stub

	}
	
	public SourceType getSelectedTypes(){
		return firstPage.getSelection();
	}

}
